package com.holly.unit.system.modular.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.holly.unit.system.modular.user.entity.SysUserOrg;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 企业员工表，用户-组织机构的关联 Mapper 接口
 *
 * @author holly
 * @date 2020/11/04 11:05
 */
public interface SysUserOrgMapper extends BaseMapper<SysUserOrg> {
    @Delete({
            "<script>",
            "DELETE  FROM   sys_user_org WHERE  user_id  in " +
            "<foreach collection='userIds' item='item' open='(' separator=',' close=')'>",
            "#{item}",
            "</foreach>",
            "</script>"
    })
    void deleteByUserIds(@Param("userIds") List<Long> userIds);
}
